package cn.hanna.springcloudalibaba.service;

import cn.hanna.springcloud.entities.CommonResult;
import cn.hanna.springcloud.entities.Payment;
import cn.hanna.springcloudalibaba.bean.OpenFeginSentinelHandler;
import cn.hanna.springcloudalibaba.service.impl.PaymentServiceFallback;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author smileha
 * @create 2021-10-22 11:18
 * @description
 */
@FeignClient(value = "cloudalibaba-sentinel-payment-provider",fallback = PaymentServiceFallback.class) // 这里使用了openfeign的降级规则
//@FeignClient(value = "cloudalibaba-sentinel-payment-provider")
public interface PaymentService {

    @GetMapping(value = "/paymentSQL/{id}")
    CommonResult<Payment> paymentSQL(@PathVariable("id") Long id);
}
